<html>
<script>
var a1 = [1,2,3];
var a2 = a1;

a2.push(4);
// check content of a1?? both are 1,2,3,4, it proves that = is pass by reference

var a3 = a2.slice(); // deep copy
a3.push(5);
// 2016-04-08 10:33PM 彻底无语了
// 2016-04-09 13:36PM suffer
// 2016-05-03 19:12PM 
// check content of a1, a2: still 1,2,3,4. not effected by a3.push
// a3: 1,2,3,4,5
var a4 = a3.slice(1); // 2,3,4,5

var a5 = a4.slice(0); // = slice()

var a6 = a5.concat([6,7]);

/*
setTimeout(function(){ 
	 while (true) {
	 	eval("debugger");
	 }
	});
*/

/*
setInterval( function(){
  var startTime = performance.now(), check,diff;
  /*for (check = 0; check < 1000; check++){
    console.log(check);
    console.clear();
  }
  diff = performance.now() - startTime;
  if (diff > 200){
    alert("Debugger detected!");
  }
},500);*/

// Jerry 2018-04-18 10:37AM - does not work!
let div = document.createElement('div');
div.innerHTML = "Jerry";
let loop = setInterval(() => {
    console.log(div);
    console.clear();
});
Object.defineProperty(div,"id", {get: () => {
    clearInterval(loop);
    alert("Dev Tools detected!");
}});

</script>